/*
public class ListNode {
    int val;
    ListNode next = null;

    ListNode(int val) {
        this.val = val;
    }
    // 考虑k超过链表长度的时候。
}*/
public class Solution {
    public ListNode FindKthToTail(ListNode head,int k) {
        ListNode head_ = head;
        int count=0;
        while(head!=null){
            count++;
            head = head.next;
        }
        if(k>count)
            return null;
        for(int i=0; i<count-k;i++){
            head_ = head_.next;
        }
        return head_;
    }
}